package com.hsogoo.study.springmvc.controller;

import com.hsogoo.study.springmvc.domain.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @Author huangsaigang
 * Created @2019-08-16.
 */
@RestController
public class HelloController {

    @RequestMapping("/test")
    public String hello(){
        return "hello spring boot with embed tomcat";
    }

    @RequestMapping(value = "/export", method = RequestMethod.POST)
    public String export(HttpServletRequest request, User user, HttpServletResponse response){

        System.out.println(request.getCharacterEncoding());
        return "ok";

    }


}
